import request from "./index.js"

// 获取学生任务书列表
export function getStudentAssignment() {
  return request({
    method:'get',
    url: '/assignment/student'  
  })
}
// 通过 id 获取任务书详情
export function getAssignmentById(assignmentId) {
  return request({
    method:'get',
    url: `/assignment/${assignmentId}`  
  })
}
// 获取教师任务书列表
export function getTeachertAssignmentListByPage(data) {
  return request({
    method:'post',
    url: '/assignment/teacher'  ,
    data
  })
}
// 获取教师任务书总数
export function getTeachertAssignmentTotal() {
  return request({
    method:'get',
    url: '/assignment/teacher/total'  
  })
}

// 教师发布任务书
export function teachertPublishAssignment(data) {
  return request({
    method:'post',
    url: '/assignment/publish',
    data 
  })
}

// 领导获取需要审核的任务书列表
export function getLeaderCheckAssignmentByPage(data) {
  return request({
    method:'post',
    url: '/assignment/leader/check',
    data 
  })
}

// 领导获取需要审核的任务书总数
export function getLeaderCheckAssignmentTotal() {
  return request({
    method:'get',
    url: '/assignment/leader/check/total' 
  })
}

// 领导获取需要审核的任务书总数
export function checkAssignmentById(data) {
  return request({
    method:'post',
    url: '/assignment/leader/check/one' ,
    data
  })
}


// 领导获取已审核的任务书列表
export function getLeaderCheckedAssignmentByPage(data) {
  return request({
    method:'post',
    url: '/assignment/leader/checked',
    data 
  })
}

// 领导获取已审核的任务书总数
export function getLeaderCheckedAssignmentTotal() {
  return request({
    method:'get',
    url: '/assignment/leader/checked/total' 
  })
}

// 领导获取需要审核的任务书总数
export function leaderCancelCheckedAssignmentById(id) {
  return request({
    method:'get',
    url: `/assignment/leader/cancel/checked/${id}` 
  })
}